<template>
  <div id="app">
    <Header></Header>
    <!--配置完了路由,需要加路由组件出口-->
    <router-view></router-view>
    <Footer v-if="$route.meta.isShowFooter"></Footer>
    <!--利用路由meta实现登录和注册2个页面隐藏脚部,其他页面显示-->
  </div>
</template>

<script>
import Header from './components/Header/index.vue'
import Footer from './components/Footer/index.vue'
export default {
  name: 'App',
  components: {
    Header,
    Footer
  },
  mounted() {
    //写在这里让请求只请求一次,优化性能,不用写在typeNav切换组件就请求一次,获取三级分类列表数据
    this.$store.dispatch("categoryList");
  }
}
</script>

<style>
img[lazy="loading"]{
    width: 215px;
    height: 255px;
}
</style>
